home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form MaskDemo
- BorderStyle = 1 'Fixed Single
- Caption = "Mask Demo"
- ClientHeight = 6960
- ClientLeft = 1170
- ClientTop = 1470
- ClientWidth = 6165
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 7365
- Icon = 0
- Left = 1110
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 464
- ScaleMode = 3 'Pixel
- ScaleWidth = 411
- Top = 1125
- Width = 6285
- Begin CommandButton Command2
- Caption = "Clear"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 435
- Left = 3990
- TabIndex = 5
- Top = 3450
- Width = 2175
- End
- Begin CommandButton Command1
- Caption = "(Destination AND Mask) XOR Image"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 435
- Left = 0
- TabIndex = 4
- Top = 3450
- Width = 3990
- End
- Begin PictureBox Pic_Mask
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 3075
- Left = 3090
- Picture = MASKDEMO.FRX:0000
- ScaleHeight = 205
- ScaleMode = 3 'Pixel
- ScaleWidth = 205
- TabIndex = 1
- Top = 0
- Width = 3075
- End
- Begin PictureBox Pic_Image
- AutoSize = -1 'True
- BorderStyle = 0 'None
- Height = 3075
- Left = 0
- Picture = MASKDEMO.FRX:53C2
- ScaleHeight = 205
- ScaleMode = 3 'Pixel
- ScaleWidth = 205
- TabIndex = 0
- Top = 0
- Width = 3075
- End
- Begin Label Label2
- Alignment = 2 'Center
- Caption = "Mask"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 13.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 3090
- TabIndex = 3
- Top = 3060
- Width = 3075
- End
- Begin Label Label1
- Alignment = 2 'Center
- Caption = "Image"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 13.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 375
- Left = 0
- TabIndex = 2
- Top = 3060
- Width = 3060
- End
- DefInt A-Z
- Declare Function BitBlt Lib "Gdi" (ByVal destHdc, ByVal X, ByVal Y, ByVal w, ByVal h, ByVal srcHdc, ByVal srcX, ByVal srcY, ByVal Rop As Long)
- Const SRCAND = &H8800C6
- Const SRCINVERT = &H660046
- Sub Command1_Click ()
- Refresh
- ' ** Display Bitmap with center of it being transparent
- ' Logic is: (Dest AND Mask) XOR Image
- '
- YDest = Command1.Top + Command1.Height
- R = BitBlt(Hdc, 0, YDest, Pic_Mask.Width, Pic_Mask.Height, Pic_Mask.Hdc, 0, 0, SRCAND)
- R = BitBlt(Hdc, 0, YDest, Pic_Image.Width, Pic_Image.Height, Pic_Image.Hdc, 0, 0, SRCINVERT)
- XDest = Pic_Image.Width + 1
- R = BitBlt(Hdc, XDest, YDest, Pic_Mask.Width, Pic_Mask.Height, Pic_Mask.Hdc, 0, 0, SRCAND)
- R = BitBlt(Hdc, XDest, YDest, Pic_Image.Width, Pic_Image.Height, Pic_Image.Hdc, 0, 0, SRCINVERT)
- End Sub
- Sub Command2_Click ()
- Refresh
- End Sub
- Sub Form_Load ()
- Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
- End Sub
- Sub Form_Paint ()
- ' ** Display something random text on the form **
- '
- Cls
- CurrentY = Command1.Top + Command1.Height
- Rows = (ScaleHeight - CurrentY) \ TextHeight(" ")
- For Y = 1 To Rows
- Print "DESTINATION DESTINATION"
- Next Y
- End Sub
- Sub Form_Resize ()
- Refresh
- End Sub
-